﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Windows.Input;

namespace DependencyInjection
{
  public  class ShowMessageViewModel
    {
        private readonly IMainEngine  _mainEngine;
        private readonly IViewingScreen _viewingScreen;
        private readonly IMessageService _messageService;

        public ShowMessageViewModel(IMainEngine mainEngine, IViewingScreen viewingScreen,IMessageService messageService)
        {
            _mainEngine = mainEngine; 
            _viewingScreen = viewingScreen;
            _messageService = messageService;
            ShowMessageCommand = new RelayCommand(ShowMessage);
        }
        public ICommand ShowMessageCommand { get; }

        public void ShowMessage()
        {
            _messageService.ShowMessageAsync(_mainEngine.CPU() +"\n"+ _viewingScreen.Show());
        }
    }
}
